/**
 * 
 */
package com.jjt.kiki.util;

import java.util.Set;

import javax.validation.ConstraintViolation;



/**
 * @author jjtEatJava
 *
 */
public class MyConstraintViolationMessgaeFormatter {
	public static <T>String formatter(Set<ConstraintViolation<T>> set){
		StringBuilder sb = new StringBuilder();
		sb.append("error count#"+set.size()+"   ");
		for(ConstraintViolation<T> f:set){
			sb.append("(");
			sb.append(f.getPropertyPath().toString());
			sb.append("#");
			sb.append(f.getMessage());
			sb.append(")");
			sb.append(" | ");
		}
		sb.setLength(sb.length()-2);
		return sb.toString();
	}
}
